package com.gitee.xhs.windowState;

import com.gitee.xhs.sampleRecod.transactionRecord.Transaction;
import com.gitee.xhs.sampleRecod.transactionRecord.TransactionIterator;
import com.gitee.xhs.sampleRecod.transactionRecord.jmockTool.TransactionLoopOneToFiveMockerInterceptor;
import com.gitee.xhs.sourceIterator.RateLimitedIterator;
import org.apache.flink.streaming.api.functions.source.FromIteratorFunction;

import static com.gitee.xhs.enums.OnTimeEnum.*;
import static com.gitee.xhs.enums.RegularEnum.*;
import static com.gitee.xhs.sampleRecod.transactionRecord.jmockTool.TransactionLoopOneToFiveMockerInterceptor.LOOP_KEY_FIVE;


/**
 * @author BigHead
 * @date 2022/7/7 15:57
 * @description TransactionUnBoundFiveBatchSource
 */
public class TransactionUnBoundFiveBatchSource extends FromIteratorFunction<Transaction> {
    public TransactionUnBoundFiveBatchSource() {
        super(
                new RateLimitedIterator<>(
                        new TransactionIterator(
                                false,
                                new TransactionLoopOneToFiveMockerInterceptor(),
                                null,
                                null,
                                null,
                                true
                        ),
                        LOOP_KEY_FIVE,
                        SECOND,
                        1,
                        REGULAR

                )
        );
    }
}
